﻿using ModernShopping.AppCode;
using ModernShopping.AppCode.WebUtil;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace ModernShopping
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IModernShoppingService" in both code and config file together.
    [ServiceContract]
    public interface IModernShoppingService
    {
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "ListStore/{ProductCode}")]
        List<Marker> GetListStore(string ProductCode);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetProductDescription/{ProductCode}")]
        string GetProductDescription(string ProductCode);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetProductComment?ProductCode={ProductCode}&Take={Take}")]
        List<Comment> GetProductComment(string ProductCode, string Take);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "CommentProduct?ProductCode={ProductCode}&Comment={Comment}&Username={Username}")]
        bool CommentProduct(string ProductCode, string Comment, string Username);
    }
}
